{template header}
<div class="container">

<ol class="breadcrumb">
  <li><a href="{SITE_URL}">首页</a></li>
  <li><a href="{tsUrl('ask')}">问答</a></li>
  <li class="active">{$curcatearr['catename']}</li>
</ol>

<div class="panel panel-default">
  <div class="panel-body">

	<div class="row" id="wrap">
        <div class="col-md-8">
            
        <div class="main-tag">
             <div id="mainTag" class="pack">
                 <h2><span class="tag{if $selectedcate} selected{/if}">{$curcatearr['catename']}<span class="followCounter">{$curcatearr['count_topic']}</span></span></h2>
                 <a data-id="{$curcatearr['cateid']}" data-operation="follow" class="followBt main-tag-{if $selectedcate}un{/if}follow" href="javascript:void 0;">{if $selectedcate}取消关注{else}关注{/if}</a>
             </div>
             <div class="main-tag-desc">
             {$curcatearr['catedesc']}
             </div>
         </div>

         <div class="category">
              <ul>
                  <li>
                  <a {if '' == $tab}class="current"{/if} href="{tsUrl('ask', 'category', array('cateid'=>{$cateid}))}">{if '' == $tab}<span>正在讨论</span>{else}正在讨论{/if}</a>
                  </li>
                  <li id="latest">
                  <a {if 'latest' == $tab}class="current"{/if} href="{tsUrl('ask', 'category', array('cateid'=>{$cateid}, 'tab'=>'latest'))}">{if 'latest' == $tab}<span>待回答的问题</span>{else}待回答的问题{/if}</a>
                  </li>
                  <li>
                  <a {if 'hot' == $tab}class="current"{/if} href="{tsUrl('ask', 'category', array('cateid'=>{$cateid}, 'tab'=>'hot'))}">{if 'hot' == $tab}<span>热门问题</span>{else}热门问题{/if}</a>
                  </li>
              </ul>
          </div>
          <div class="main-title-line"></div>
                
          {loop $askarr $v}   
            <div class="ask">
                <div class="ask-hd">
                    <h2><a href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}" >{$v['title']}</a></h2>
                    <p class="ask-hd-r">答案&nbsp;{$v['count']}</p>
                </div>
                {if $v['cate']}
                <p class="ask-tags">
                                                  来自分类:
                    {loop $v['cate'] $k $c}
                    <a href="{tsUrl('ask', 'category', array('cateid'=>{$c['cateid']}))}">{$c['catename']}</a>{if ((count($v['cate']) - 1) > $k)}、{/if}
                    {/loop}
                </p>
                {/if}
                {if '' == $v['actionarr']['action']}
                    <div class="ask-bd">
                        <div class="pack">
                            <p class="ask-bd-act">{$v['actionarr']['addtime']}&nbsp;&nbsp;<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>&nbsp;&nbsp;提问：</p>
                            <p class="ask-bd-txt">
							{$v['content']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}">查看全部</a></p>
                        </div>
                    </div>
                {/if}
                
                {if 'ask_comment_op' == $v['actionarr']['action']}
                <div class="ask-bd">
                    <p class="ask-bd-up">{$v['actionarr']['addtime']}<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>顶了这个答案：</p>
                    <a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}" class="ask-bd-num">{$v['actionarr']['digg']}</a>
                    <div class="pack">
                        <p class="ask-bd-act"><a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['cuser']['userid']}))}">{$v['actionarr']['cuser']['username']}</a>&nbsp;&nbsp;{$v['actionarr']['commenttime']}</p>
                        <p class="ask-bd-txt">{$v['actionarr']['comment']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}">查看全部</a></p>
                    </div>
                </div>
                {/if}
                
                {if 'ask_comment' == $v['actionarr']['action']}
                <div class="ask-bd">
                     <div class="pack">
                         <p class="ask-bd-act">{$v['actionarr']['addtime']}&nbsp;&nbsp;<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>&nbsp;&nbsp;添加了一个答案：</p>
                         <p class="ask-bd-txt">{$v['actionarr']['comment']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}">查看全部</a></p>
                     </div>
                 </div>
                 {/if}
            </div>
            {/loop}

            <div class="pages mt20">
                {if 0 != $pre}
                <a class="pages-b bw_btn" href="{$url}{$pre}"><span>&lt;</span>上一页</a>
                {/if}
                {if 0 != $next}
                <a class="pages-n bw_btn" href="{$url}{$next}">下一页<span>&gt;</span></a>
                {/if}
            </div>

        </div>

        <div class="col-md-4">
            <p class="side-back"><a href="{tsUrl('ask')}">&gt;&nbsp;返回问答首页</a></p>
            <div class="side-title">
                <h2>他们关注了这个分类</h2>
                <span class="side-title-more">（<a href="javascript:void(0)">全部{$follownum}</a>）</span>
            </div>
            <div class="pack">
            {loop $followusersarr $v}
                <dl class="pack_u">
                    <dt>
                    <a href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}" title="{$v['username']}" ><img width="48" height="48" src="{$v['face']}" alt="{$v['username']}"></a>
                    </dt>
                    <dd>
                    <a href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}" title="{$v['username']}" >{$v['username']}</a>
                    </dd>
                </dl>
            {/loop}
            </div>

        <div class="side-title"><h2>该分类的活跃达人</h2></div>
		<ol class="side-chippys">
		{loop $askuserarr $k $v}
		{if $k<3}
		    <li>
		        <a class="pt-pic"  href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}">
		            <img width="48" height="48" alt="{$v['user']['username']}" src="{$v['user']['face']}">
		        </a>
		        <div class="pt-txt">
		            <h3>
		              <a  title="{$v['user']['username']}" href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}">{$v['user']['username']}</a>
		            </h3>
		        </div>
		    </li>
		{else}    
		    <li class="side-chippys-brief">
		        <a class="pt-pic"  href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}">
		            <img width="48" height="48" alt="{$v['user']['username']}" src="{$v['user']['face']}">
		        </a>
		        <div class="pt-txt">
		            <h3>
		              <a  title="Topp" href="{tsUrl('user','topic',array('id'=>{$v['userid']}))}">{$v['user']['username']}</a>
		            </h3>
		        </div>
		    </li>
		  {/if}
		  {/loop}  
		</ol>
        </div>
    </div>
    </div>
    </div>
    
    <div class="bottom"></div>
</div>
{template footer}